import * as types from './mutation-types'
import * as modules from '../modules'
import { Indicator, Toast } from 'mint-ui'

// 获取导航栏
export const getNavList = function({ commit }) {
  return modules.navModule().then(
    data => {
      commit(types.SET_NAV, data)
      return data
    },
    err => {
      return null
    }
  )
}

// indexModule
export const getIndexData = function({ commit }) {
  return modules.indexModule().then(
    data => {
      commit(types.SET_indexData, data)
      return data
    },
    err => {
      return null
    }
  )
}

// shareModule
export const getShareData = function({ commit }, parms) {
  return modules.shareModule(parms).then(
    data => {
      commit(types.SET_wxSdk, data)
      return data
    },
    err => {
      return null
    }
  )
}
